<%@ taglib uri="/WEB-INF/taglib/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/taglib/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/taglib/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/taglib/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>


<h1><bean:message key="jobs.title.search"/></h1>

<p>
		<c:choose>

			<c:when test="${all}">
				<html:link page="/jobs.do">
					<bean:message key="jobs.list.seenotcomplete" />
				</html:link>
			</c:when>

			<c:otherwise>
				<html:link page="/jobs.do?cmd=listClose">
					<bean:message key="jobs.list.seecomplete" />
				</html:link>
			</c:otherwise>

		</c:choose>

		<c:choose>
			<c:when test="${search}"></c:when>
			<c:otherwise>
				<html:link page="/jobs.do?cmd=search"><bean:message key="jobs.search.title" /></html:link>
			</c:otherwise>
		</c:choose>
</p>

<p id="list_job">

	<display:table name="jobs" id="row" requestURI="/jobs.do" pagesize="20">

		<display:column sortable="true" sortProperty="project.subject" titleKey="jobs.list.subject" >
			<html:link page="/project.do?cmd=view&id=${row.project.id}">${row.project.subject}</html:link>
		</display:column>
		<display:column sortable="true" property="project.manager.name" titleKey="jobs.list.manager"  />
		<display:column sortable="true" sortProperty="skill.name" titleKey="jobs.list.skill">
			<bean:message key="${row.skill.name}"/>
		</display:column>
		<display:column sortable="true" property="salary" titleKey="jobs.list.salary" />
		<display:column sortable="true" titleKey="jobs.list.auction">
			<c:choose>
				<c:when test="${row.auction}">
					<bean:message key="job.list.auctionok"/>
				</c:when>
				<c:otherwise>
					<bean:message key="job.list.auctionko"/>
				</c:otherwise>
			</c:choose>
		</display:column>
		<display:column titleKey="jobs.list.complete.title">
			<c:choose>
				<c:when test="${row.freelance == null}">
					<bean:message key="jobs.list.notcomplete"/>
				</c:when>
				<c:otherwise>
					<bean:message key="jobs.list.complete"/>
				</c:otherwise>
			</c:choose>
		</display:column>

		<display:column titleKey="jobs.list.candidate"><!--
			<html:form action="/application.do">
				<html:hidden property="cmd" value="create" />
				<html:hidden property="JobProjectId" value="${row.id}" />
				<html:submit><bean:message key="jobs.list.candidate.submit"/></html:submit>
			</html:form>
		-->
		<html:link page="/application.do?cmd=create&JobProjectId=${row.id}"><bean:message key="jobs.list.candidate.submit"/></html:link>
		</display:column>

		<display:setProperty name="paging.banner.placement" value="top" />
		<display:setProperty name="paging.banner.item_name"><bean:message key="jobs.list.item_name" /></display:setProperty>
		<display:setProperty name="paging.banner.items_name"><bean:message key="jobs.list.items_name" /></display:setProperty>

	</display:table>

</p>